package tpo.lmhprovider.lmhprovider.controller;

import api.wares.SpecsApi;
import dto.Dto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import pojo.Specs;
import tpo.lmhprovider.lmhprovider.service.SpecsService;

import java.util.List;
import java.util.Map;

@RestController
public class SpecsController implements SpecsApi {
    @Autowired
    SpecsService specsService;
    @Override
    public Dto<List<Specs>> getSpecs(Map map) {
        Dto dto=new Dto();
        dto.setObj(specsService.getSpecs(map));
        return dto;
    }

    @Override
    public Dto<Integer> delSpecs(Map map) {
        Dto dto=new Dto();
        dto.setObj(specsService.delSpecs(map));
        return dto;
    }

    @Override
    public Dto<Integer> addSpecs(Map map) {
        Dto dto=new Dto();
        dto.setObj(specsService.addSpecs(map));
        return dto;
    }

    @Override
    public Dto<Integer> updateSpecs(Map map) {
        Dto dto=new Dto();
        dto.setObj(specsService.updateSpecs(map));
        return dto;
    }
}
